#ifndef MODEL3D_H
#define MODEL3D_H

#include <coord.h>
#include <stdint.h>


typedef struct model3d
{
  coord3d_t size;
  uint16_t *buffer;
} model3d_t;


model3d_t *
model3d_new( uint16_t width, uint16_t height, uint16_t depth );

void
model3d_free( model3d_t *model3d );

#define VOXEL_AT( m, x0, y0, z0 ) \
  ( (m)->buffer[ CUB_TO_LIN( (m)->size.x, (m)->size.y, (x0), (y0), (z0) ) ] )



#endif /* MODEL3D_H */
